﻿<Window x:Class="Microsoft.Samples.Kinect.KinectExplorer.Pictures"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:Kinect_Repository;assembly=Kinect_Repository"
        Title="Pictures" Height="300" Width="300">
    <Window.Resources>
        <DataTemplate x:Key="MyImageTemplate">
            <StackPanel>
                <Image Source="{Binding Path=PathFile}" />
                <Button Content="{Binding Path=PathFile}" CommandParameter="{Binding Path=PathFile}" Command ="{Binding Path=DataContext.OpenCommand, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Window.DataContext>
        <local:PicturesApplicationViewModel ></local:PicturesApplicationViewModel>
    </Window.DataContext>
    <Grid Name="grdView">
        <Grid.RowDefinitions>
            <RowDefinition Height="46*" />
            <RowDefinition Height="215*" />
        </Grid.RowDefinitions>
        <DatePicker Grid.Row="0" Height="25" HorizontalAlignment="Left" Margin="69,12,0,0" Name="dtpDatas" VerticalAlignment="Top" Width="115" SelectedDate="{Binding Path=SelectedDate}" />

        <DockPanel Grid.Row="1" >
            <ListBox
      DockPanel.Dock="Left" 
      ItemsSource="{Binding Path=FilesOnDate}"
      ItemTemplate="{StaticResource MyImageTemplate}" />
            
        </DockPanel>
        
        
        
    </Grid>
</Window>
